package com.zysoft.common.dao;

import java.io.Serializable;

import com.zysoft.common.entity.AbstractEntity;

public interface ICommonDao {
    
    public <T extends AbstractEntity> T save(T model);

    public <T extends AbstractEntity> void saveOrUpdate(T model);
    
    public <T extends AbstractEntity> void update(T model);
    
    public <T extends AbstractEntity> void merge(T model);

    public <T extends AbstractEntity, PK extends Serializable> void delete(Class<T> entityClass, PK id);

    public <T extends AbstractEntity> void deleteObject(T model);

    public <T extends AbstractEntity, PK extends Serializable> T get(Class<T> entityClass, PK id);
    
    public int executeUpdate(final String hqlUpdate, final Object... paramlist);
    
}
